﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Microsoft.Reporting.WebForms;

namespace PeisongWeb
{
    public partial class seller_AssessmentReport :customerPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dt;
                if (Request.QueryString["sellerId"] != null || Request.QueryString["tag"] != null || Request.QueryString["id"] != null)
                {
                    int sellerId = Convert.ToInt32(Request.QueryString["sellerId"].ToString());
                    int tag = Convert.ToInt32(Request.QueryString["tag"].ToString());
                    int id = Convert.ToInt32(Request.QueryString["id"].ToString());

                    dt = logic.assessmentWeek.P_AssessmentWeek(sellerId, tag, id);
                    ReportDataSource rds = new ReportDataSource("seller_Assessment_DataTable1", dt);
                    ReportViewer1.LocalReport.DataSources.Clear();
                    ReportViewer1.LocalReport.DataSources.Add(rds);
                    ReportViewer1.LocalReport.Refresh();
                    if (dt.Rows.Count == 0)
                    {
                        ReportViewer1.Visible = false;
                        div_nodata.Visible = true;
                    }
                    else
                    {
                        div_nodata.Visible = false;
                    }
                }
                else
                {
                    Library.Script.ClientMsgUrl("错误的参数。", "reportCustomer.aspx");
                }
            }
        }
    }
}
